{extend name="public:base" /}
{block name="action"}
<a type="button" class="btn btn-w-m btn-primary"
   href="{:url('dc7')}">  导出
</a>
{/block}
{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight" xmlns="http://www.w3.org/1999/html">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="get">
                        <div class="row">
                            <div class="col-sm-3">
<!--                                 <select class="form-control m-b" name="sealId" placeholder="印章名称">
                                    <option value="" {if condition="!$params.sealId" } selected {
                                    /if}>所有</option>
                                    {volist name="seals" id="entity"}
                                    <option value="{$entity.id}" {eq name="entity.id" value="$params.sealId" } selected
                                            {
                                    /eq}>{$entity.name}</option>
                                    {/volist}
                                </select> -->
                                <select class="form-control m-b" name="sealId" placeholder="印章名称">
                                    <option value="">所有</option>
                                    {volist name="seals" id="entity"}
                                    <option value="{$entity.id}" {if condition="$entity.id == $params.sealId"}selected{/if}>{$entity.name}</option>
                                    {/volist}
                                </select>
                            </div>
                            <div class="col-sm-4" id="dateTime">
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="input-group">
                                            <input type="text" name="startTime" id="startTime"
                                                   value="{$params.startTime}"
                                                   readonly unselectable="on"
                                                   placeholder="开始时间"
                                                   class="form-control">
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="input-group">
                                            <input type="text" name="endTime" id="endTime" value="{$params.endTime}"
                                                   placeholder="结束时间"
                                                   readonly unselectable="on"
                                                   class="form-control">
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2">
                                <div class="input-group">
                                    <input type="text" name="name" value="{$params.name}" placeholder="文件名称"
                                           class="form-control">
                                    <div class="input-group-append">
                                        <button type="submit" class="btn btn-sm btn-primary"><i
                                                class="fa fa-search"></i> 搜索
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div>

                        <table class="table table-stripped ">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>印章名称</th>
                                <th>审批类型</th>
                                <th>文件名称</th>
                                <th>文件编号</th>
                                <th>实际次数</th>
                                <th>申请人</th>
                                <th>状态</th>
                                <th>申请时间</th>
                                <th>审核人</th>
                                <th>审核时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {notempty name="list"}
                            {volist name="list" id="vo" key="k"}
                            <tr>
                                <td>{$k}</td>
                                <td>{$vo.seal.name}</td>
                                <td>{$vo.approval.type_name}</td>
                                <td>{$vo.name}</td>
                                <td>{$vo.file_number}</td>
                                <td>{$vo.use_count}</td>
                                <td>{$vo.user.username}</td>
                                <td>{$vo.status_txt}</td>
                                <td>{$vo.create_time}</td>
                                <td>
                                    {if condition="sizeof($vo.effectiveProcessFlow)>0"}
                                    {$vo.effectiveProcessFlow[0]['user']['username']}
                                    {/if}
                                </td>
                                <td>
                                    {if condition="sizeof($vo.effectiveProcessFlow)>0"}
                                    {$vo.effectiveProcessFlow[0]['app_time']}
                                    {/if}
                                </td>
                                <td class="project-actions ">
                                    <a href="{:url('show')}?id={$vo.id}"
                                       class="btn btn-primary btn-sm detail"><i
                                            class="fa fa-eye"></i> 详情 </a>
                                </td>
                            </tr>
                            {/volist}
                            {/notempty}
                            </tbody>
                        </table>
                        {$list->render()}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script type="text/javascript">
    laydate.render({
        elem: "#dateTime",
        //设置开始日期、日期日期的 input 选择器
        //数组格式为 5.3.0 开始新增，之前版本直接配置 true 或任意分割字符即可
        range: ['#startTime', '#endTime']
    });
    $(".process-flow-btn-dialog").on("click", function (e) {
        e.preventDefault();
        $.get($(e.currentTarget).attr("href"), function (data) {
            new ModalDialog({
                content: data,
                closeBtn: false,
                success: function (data) {
                    return true;
                }
            }).show();
        })
    });
</script>
{/block}
{block name="css"}
<link rel="stylesheet" href="__ADMIN__/css/process-timeline.css">
{/block}